<!DOCTYPE html>
<html>

<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <title>Examples</title>
  <meta name="description" content="">
  <meta name="keywords" content="">
  <link href="" rel="stylesheet">
  <style>
    .bounce-enter-active {
      animation: bounce-in .5s;
    }

    .bounce-leave-active {
      animation: bounce-in .5s reverse;
    }

    @keyframes bounce-in {
      0% {
        transform: translateX(100px);
        opacity: 0;
      }

      100% {
        transform: translateX(0px);
        opacity: 1;
      }
    }
  </style>
  <script type="text/javascript" src="lib/vue.js"></script>
</head>

<body>

  <div id="box">
    <button @click="isShow=!isShow">click</button>

    <!-- mode="out-in" A元素先离去 B元素再进来 -->
    <transition name="bounce" mode="out-in">
      <p v-if="isShow" key="1">11111111111</p>
      <p v-else key="2">222222222</p>
    </transition>

  </div>

  <script>
    var vm = new Vue({
      el: "#box",
      data: {
        isShow: true
      }
    })

  </script>
</body>

</html>